package com.xiaxiang.xiawan.NetBean;

import com.google.gson.Gson;

/**
 * Created by mk on 2017/11/24.
 */

public class ErrorNetBean {
    /**
     * code : 11001
     * errorMsg : 请先登录
     */

    private int CODE_NEED_LOGIN = 11001;
    private int code;
    private String errorMsg;

    public static ErrorNetBean objectFromData(String str) {

        return new Gson().fromJson(str, ErrorNetBean.class);
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public int getCode() {
        return code;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
    public boolean needLogin(){
        return getCode() == CODE_NEED_LOGIN;
    }
}
